/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import gui.menu.edit.RedoItem;
import gui.menu.edit.UndoItem;
import gui.menu.file.ConfigureExporters;
import gui.menu.view.ViewMenu;
import gui.menu.file.ImportFromXmlItem;
import gui.menu.file.ExportToXmlItem;
import gui.menu.classDiagram.AddImplementationItem;
import gui.menu.classDiagram.DeleteMemberItem;
import gui.menu.classDiagram.DeleteMethodItem;
import gui.menu.classDiagram.AddInterfaceItem;
import gui.menu.classDiagram.AddMethodItem;
import gui.menu.classDiagram.AddClassItem;
import gui.menu.classDiagram.AddMemberItem;
import gui.menu.stateDiagram.AddConditionalTransitionItem;
import gui.menu.stateDiagram.AddStateItem;
import gui.menu.stateDiagram.AddTransitionItem;
import java.awt.*;
import javax.swing.*;

public class MainWindow extends JFrame {

    WorkArea workArea = null;
	private JPanel panel1;
	private WorkArea workArea1;

	protected ConfigureExporters configureExporters;

	public MainWindow(String title, WorkArea workArea,
	                  ConfigureExporters configureExporters) {
        super(title);

		this.configureExporters = configureExporters;
		this.workArea = workArea;


		setSize(new Dimension(1024, 768));
        addMenu();

        Container contentPane = getContentPane();
        contentPane.setLayout(new BorderLayout());

        contentPane.add(workArea);
	}

    private void addMenu() {
        JMenuBar menuBar = new JMenuBar();

        JMenu file = new JMenu("File");
	    JMenu edit = new JMenu("Edit");
        JMenu actionsCD = new JMenu("Actions for Class Diagram");
        JMenu actionsSD = new JMenu("Actions for State Diagram");

        actionsCD.add(new AddClassItem());
        actionsCD.add(new AddInterfaceItem());
        actionsCD.add(new AddMethodItem());
        actionsCD.add(new AddMemberItem());
        actionsCD.add(new DeleteMemberItem());
        actionsCD.add(new DeleteMethodItem());
        actionsCD.add(new AddImplementationItem());
        
        actionsSD.add(new AddStateItem());
        actionsSD.add(new AddTransitionItem());
        actionsSD.add(new AddConditionalTransitionItem());

        //file.add(new ImportFromXmlItem());
        //file.add(new ExportToXmlItem());

	    edit.add(new UndoItem());
	    edit.add(new RedoItem());

	    //configureExporters.addExporters(file);
        
        //add menus to menubar
        menuBar.add(file);
	    menuBar.add(edit);
        menuBar.add(new ViewMenu());
        menuBar.add(actionsCD);
        menuBar.add(actionsSD);

        setJMenuBar(menuBar);
    }
}
